package com.offcn.Servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/login")
public class LoginServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        // 假设 输入库里面就一条数据 叫做 name = admin password = 123
        String name = req.getParameter("name");
        String password = req.getParameter("password");
        if ("admin".equals(name) && "123".equals(password)){
            resp.getWriter().print("<h1>cg</h1>");
        }else{
            resp.getWriter().print("<h1>shibai</h1>");
        }

    }
}
